-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Adding more settings and control over Gemini #4895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adding more settings and control over Gemini #4895
Conversation
- with topP, topK, maxOutputTokens - allow users to enable URL context and Grounding Research
… + working with profile-specific thresholding
…iption and titles to settings for translation purposes
…ng will also change in Gemini context management - sync between Context Management Settting <-> Gemini Context Management with regards to thresholding
|
This PR is finally done :) I still need to add a demo video and motivation behind context management section for Gemini and |
| "geminiParameters": { | ||
| "topK": { | ||
| "title": "शीर्ष K", | ||
| "description": "प्रत्येक चरण के लिए विचार करने के लिए उच्चतम संभावना वाले टोकनों की संख्या को नियंत्रित करता है। उच्च मान विविधता बढ़ाते हैं, निम्न मान आउटपुट को अधिक केंद्रित और निर्धार्त बनाते हैं।" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical error: In the 'topK' description, "निर्धार्त" should likely be "निर्धारित".
| "description": "प्रत्येक चरण के लिए विचार करने के लिए उच्चतम संभावना वाले टोकनों की संख्या को नियंत्रित करता है। उच्च मान विविधता बढ़ाते हैं, निम्न मान आउटपुट को अधिक केंद्रित और निर्धार्त बनाते हैं।" | |
| "description": "प्रत्येक चरण के लिए विचार करने के लिए उच्चतम संभावना वाले टोकनों की संख्या को नियंत्रित करता है। उच्च मान विविधता बढ़ाते हैं, निम्न मान आउटपुट को अधिक केंद्रित और निर्धारित बनाते हैं।" |
|
@daniel-lxs I had a small discussion with the team and maybe we should put the "Output controls" ( It may align with your goal to make it less confusing for the users and for me it actually looks clearer. Let me know what do you think about this. |
…rameters - Fixed duplicate keys in 13 localization files (es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi) - Removed second occurrence of geminiSections and geminiParameters keys - Kept first occurrence which contains more comprehensive descriptions - All JSON files validated for syntax correctness - Translation completeness verified with missing translations script Resolves duplicate key issue identified in PR RooCodeInc#4895
|
✅ No security or compliance issues detected. Reviewed everything up to 847756c. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. Reply to this PR with |
|
✅ Issue Already Resolved The duplicate translation keys issue has already been fixed! Summary:
Files verified:
The duplicate key consolidation work is complete and the localization files are in good shape! |
|
As for the other discussions that I think might take a little longer and I would like to separate from the two additions above:
Thank you very much for your contributions and your patience in figuring out the best way to integrate them! |
Alright, got it! Let's discuss this more for sure. Yeah, it doesn't have to be only for Gemini. I am focusing on Gemini initially because I am most familiar with it and have a DeepMind team to help provide ground-truth sources to back my proposals. This gives me more confidence that my contributions are truly beneficial to Roo Code. That said, I am certainly open to implementing features for other providers too :) Going forward, I will try to design new features in a way so they are more abstract or implementing adapters so that other providers can adopt them too if relevant. But back to the issue: I can implement this the same way temperature control is, and I agree with putting all of them in the advanced settings. I will reiterate with the team about the parameters. |
…rch (#5959) * feat: Adding more settings and control over Gemini - with topP, topK, maxOutputTokens - allow users to enable URL context and Grounding Research * feat: Adding parameter titles and descriptions + translation to all languages * feat: adding more translations * feat: adding `contextLimit` implementation from `maxContextWindow` PR + working with profile-specific thresholding * feat: max value for context limit to model's limit + converting description and titles to settings for translation purposes * feat: all languages translated * feat: changing profile-specific threshold in context management setting will also change in Gemini context management - sync between Context Management Settting <-> Gemini Context Management with regards to thresholding * feat: max value of maxOutputTokens is model's maxTokens + adding more tests * feat: improve unit tests and adding `data-testid` to slider and checkbox components * fix: small changes in geminiContextManagement descriptions + minor fix * fix: Switching from "Gemini Context Management" to "Token Management - better naming and correct purpose * fix: input field showed NaN -> annoying UX * fix: Removing redundant "tokens" after the "set context limit"'s checkbox + removing the lengthy description * fix: Changing the translation to be consistent with the english one * fix: more translations * fix: translations * fix: removing contextLimit and token management related code - due to the decision in: #3717 * fix: removing `contextLimit` test and removing token management in translations * fix: changing from `Advanced Features` to `Tools` to be consistent with Gemini docs/AI studio * fix: adding `try-catch` block for `generateContentStream` * feat: Include citations + improved type safety * feat: adding citation for streams (generateContextStream) * fix: set default values for `topP`, `topK` and `maxOutputTokens` * fix: changing UI/UX according to the review/feedback from `daniel-lxs` * fix: updating the `Gemini.spec.tsx` unit test - testing when it is hidden - testing when users click on the collapsible trigger and model configuration appears * fix: more changes from the feedback/review from `daniel-lxs` * fix: adding sources at the end of the stream to preserve * fix: change the description for grounding with google search and url context * fix: adding translations * fix: removing redundant extra translations - a mistake made by the agent * fix: remove duplicate translation keys in geminiSections and geminiParameters - Fixed duplicate keys in 13 localization files (es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi) - Removed second occurrence of geminiSections and geminiParameters keys - Kept first occurrence which contains more comprehensive descriptions - All JSON files validated for syntax correctness - Translation completeness verified with missing translations script Resolves duplicate key issue identified in PR #4895 * fix: delete topK, topP and maxOutputTokens from Gemini * fix: deleting topK, topP and maxOutputTokens from translations/locales * fix: adjust spacing between labels and descriptions + sentence casing * fix: adding maxOutputTokens back and removing unknown type * fix: internalizing error Gemini error message * fix: updating tests in Gemini and Vertex to adjust to the new error logging * fix: address PR review feedback for Gemini tools feature - Fix Hindi translation grammatical error in settings.json - Internationalize 'Sources:' string and error messages in gemini.ts - Add comprehensive error scenario tests to gemini-handler.spec.ts - Remove unused currentModelId prop from Gemini component - Update all locale files with new translation keys --------- Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: Daniel Riccio <[email protected]>
|
Closing for now since some of these settings are already in Roo Code |
Sounds good! |
…rch (RooCodeInc#5959) * feat: Adding more settings and control over Gemini - with topP, topK, maxOutputTokens - allow users to enable URL context and Grounding Research * feat: Adding parameter titles and descriptions + translation to all languages * feat: adding more translations * feat: adding `contextLimit` implementation from `maxContextWindow` PR + working with profile-specific thresholding * feat: max value for context limit to model's limit + converting description and titles to settings for translation purposes * feat: all languages translated * feat: changing profile-specific threshold in context management setting will also change in Gemini context management - sync between Context Management Settting <-> Gemini Context Management with regards to thresholding * feat: max value of maxOutputTokens is model's maxTokens + adding more tests * feat: improve unit tests and adding `data-testid` to slider and checkbox components * fix: small changes in geminiContextManagement descriptions + minor fix * fix: Switching from "Gemini Context Management" to "Token Management - better naming and correct purpose * fix: input field showed NaN -> annoying UX * fix: Removing redundant "tokens" after the "set context limit"'s checkbox + removing the lengthy description * fix: Changing the translation to be consistent with the english one * fix: more translations * fix: translations * fix: removing contextLimit and token management related code - due to the decision in: RooCodeInc#3717 * fix: removing `contextLimit` test and removing token management in translations * fix: changing from `Advanced Features` to `Tools` to be consistent with Gemini docs/AI studio * fix: adding `try-catch` block for `generateContentStream` * feat: Include citations + improved type safety * feat: adding citation for streams (generateContextStream) * fix: set default values for `topP`, `topK` and `maxOutputTokens` * fix: changing UI/UX according to the review/feedback from `daniel-lxs` * fix: updating the `Gemini.spec.tsx` unit test - testing when it is hidden - testing when users click on the collapsible trigger and model configuration appears * fix: more changes from the feedback/review from `daniel-lxs` * fix: adding sources at the end of the stream to preserve * fix: change the description for grounding with google search and url context * fix: adding translations * fix: removing redundant extra translations - a mistake made by the agent * fix: remove duplicate translation keys in geminiSections and geminiParameters - Fixed duplicate keys in 13 localization files (es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi) - Removed second occurrence of geminiSections and geminiParameters keys - Kept first occurrence which contains more comprehensive descriptions - All JSON files validated for syntax correctness - Translation completeness verified with missing translations script Resolves duplicate key issue identified in PR RooCodeInc#4895 * fix: delete topK, topP and maxOutputTokens from Gemini * fix: deleting topK, topP and maxOutputTokens from translations/locales * fix: adjust spacing between labels and descriptions + sentence casing * fix: adding maxOutputTokens back and removing unknown type * fix: internalizing error Gemini error message * fix: updating tests in Gemini and Vertex to adjust to the new error logging * fix: address PR review feedback for Gemini tools feature - Fix Hindi translation grammatical error in settings.json - Internationalize 'Sources:' string and error messages in gemini.ts - Add comprehensive error scenario tests to gemini-handler.spec.ts - Remove unused currentModelId prop from Gemini component - Update all locale files with new translation keys --------- Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: Daniel Riccio <[email protected]>


Related GitHub Issue
Closes: #4519
Description
Test Procedure
Gemini parameters
(1) Go to Settings
(2) Click on the provider)
(3) Try to modify topP, topK and maxOutputTokens
Gemini Context Management(1) Go to Settings(2) Click on the provider)(3) Enable use of custom context limit(4) Set contextLimit and profile-specific thresholding to condense at particular tokensn(5) Go back to chat and reachn(6) Ifnis reached then it will condense the conversationGemini Tools
(1) Go to Settings
(2) Click on the provider)
(3) Enable URL context
(4) Go back to chat and try to write a prompt with having an URL in there
(1) Go to Settings
(2) Click on the provider)
(3) EnableGrounding with Google Search
(4) Go back to chat and try to write a prompt. It should search for resources online.
Unit Tests
Gemini.spec.tsxgemini-handler.spec.tsType of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Overall UI change
URL Context
Grounding with Google Search
Example #1
Example #2
Documentation Updates
Additional Notes
contextLimitcan use functionality and implementation from this PR: #4360 for users to strategically set max context window. Better naming and description will be made.Get in Touch
Important
Adds customizable settings for Gemini provider, including
topP,topK,maxOutputTokens, and context options, with corresponding UI and tests.topP,topK,maxOutputTokens, andcontextLimitinprovider-settings.ts.provider-settings.ts.GeminiHandleringemini.tsnow slices messages based oncontextLimitand configures tools for URL context and grounding.maxOutputTokens,topP,topK, and tools configuration.gemini-handler.spec.tsto testGeminiHandlerfunctionalities.Gemini.spec.tsxto test UI components for Gemini settings.ApiOptions.tsxandSettingsView.tsxto include new Gemini settings.Gemini.tsxnow supports sliders fortopP,topK,maxOutputTokens, and context management options.This description was created by
for 1497edd. You can customize this summary. It will automatically update as commits are pushed.